package com.ikaros.api;

import java.util.Set;

import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;

/**
 * @author: 胡国军
 * @Date 2018-01-06 15:53
 */
public class ceshi {
    public static void main(String[] args) {
        String str="{\"shop_json\":{\"sub0\":[\"a0,b2\",\"红米\",\"699\",\"10\",\"图片1~图片2~\"],\"sub1\":[\"a0,b3\",\"黑米\",\"799\",\"10\",\"嘿米图1~\"]}}";
        JSONObject jo= JSON.parseObject(str);
        JSONObject shop=jo.getJSONObject("shop_json");
        Set<String> keys=shop.keySet();
        for(String kk:keys){
            System.out.println(kk+"----------------");
            JSONArray ja=shop.getJSONArray(kk);
            for(int i=0;i<ja.size();i++){
                System.out.println(ja.get(i));
            }
        }
    }
}
